import * as React from 'react';
import WorkViewComponent, { IWorkViewProps, IWorkViewState } from '../../component/common/WorkViewComponent';

import CustomerList from './CustomerList';
import CustomerDetail from './CustomerDetail';
import CustomerInfo from './CustomerInfo';

export const RootHash = '#/customer';

export const RootView = {
  id: 20,
  deep: 2,
  pathRegExp: /^#\/customer\/?[\s\S]*?$/,
  path: '#/customer',
  paramPath: '#/customer',
  name: 'customer',
  text: '顾客列表',
  component: CustomerList,
};

export const StackViewPages = [];
StackViewPages.push({
  id: 201,
  deep: 3,
  pathRegExp: /^#\/customer\/add\/?[\s\S]*?$/,
  path: '#/customer/add',
  paramPath: '#/customer/add',
  name: 'CustomerAdd',
  text: '创建顾客',
  component: CustomerDetail,
});
StackViewPages.push({
  id: 202,
  deep: 3,
  pathRegExp: /^#\/customer\/view\/[\s\S]{1,100}\/?$/,
  path: '#/customer/view',
  paramPath: '#/customer/view/${id}',
  name: 'CustomerView',
  text: '查看顾客',
  component: CustomerInfo
});
StackViewPages.push({
  id: 203,
  deep: 3,
  pathRegExp: /^#\/customer\/edit\/[\s\S]{1,100}\/?$/,
  path: '#/customer/edit',
  paramPath: '#/customer/edit/${id}',
  name: 'CustomerEdit',
  text: '编辑顾客',
  component: CustomerDetail
});

export default class Customer extends WorkViewComponent<IWorkViewProps, IWorkViewState> {

  providerPages() {
    return StackViewPages;
  }

  providerRootView() {
    return RootView;
  }

}
